home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / comm1 / intsdkss.lha / include / sys / syslog.h < prev    next >
C/C++ Source or Header  |  1996-04-09  |  4KB  |  108 lines

  1. /*
  2.  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms are permitted
  6.  * provided that the above copyright notice and this paragraph are
  7.  * duplicated in all such forms and that any documentation,
  8.  * advertising materials, and other materials related to such
  9.  * distribution and use acknowledge that the software was developed
  10.  * by the University of California, Berkeley.  The name of the
  11.  * University may not be used to endorse or promote products derived
  12.  * from this software without specific prior written permission.
  13.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  14.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  15.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  16.  *
  17.  * >>>>>>>>>>>>>>> This file received from uunet.uu.net <<<<<<<<<<<<<<<<<<<
  18.  *
  19.  *    @(#)syslog.h    7.10 (Berkeley) 6/27/88
  20.  */
  21.  
  22. /*
  23.  *  Facility codes
  24.  */
  25.  
  26. #define LOG_KERN    (0<<3)    /* kernel messages */
  27. #define LOG_USER    (1<<3)    /* random user-level messages */
  28. #define LOG_MAIL    (2<<3)    /* mail system */
  29. #define LOG_DAEMON    (3<<3)    /* system daemons */
  30. #define LOG_AUTH    (4<<3)    /* security/authorization messages */
  31. #define LOG_SYSLOG    (5<<3)    /* messages generated internally by syslogd */
  32. #define LOG_LPR        (6<<3)    /* line printer subsystem */
  33. #define LOG_NEWS    (7<<3)    /* network news subsystem */
  34. #define LOG_UUCP    (8<<3)    /* UUCP subsystem */
  35.     /* other codes through 15 reserved for system use */
  36. #define LOG_LOCAL0    (16<<3)    /* reserved for local use */
  37. #define LOG_LOCAL1    (17<<3)    /* reserved for local use */
  38. #define LOG_LOCAL2    (18<<3)    /* reserved for local use */
  39. #define LOG_LOCAL3    (19<<3)    /* reserved for local use */
  40. #define LOG_LOCAL4    (20<<3)    /* reserved for local use */
  41. #define LOG_LOCAL5    (21<<3)    /* reserved for local use */
  42. #define LOG_LOCAL6    (22<<3)    /* reserved for local use */
  43. #define LOG_LOCAL7    (23<<3)    /* reserved for local use */
  44.  
  45. #define LOG_NFACILITIES    24    /* maximum number of facilities */
  46. #define LOG_FACMASK    0x03f8    /* mask to extract facility part */
  47.  
  48. #define LOG_FAC(p)    (((p) & LOG_FACMASK) >> 3)    /* facility of pri */
  49.  
  50. /*
  51.  *  Priorities (these are ordered)
  52.  */
  53.  
  54. #define LOG_EMERG    0    /* system is unusable */
  55. #define LOG_ALERT    1    /* action must be taken immediately */
  56. #define LOG_CRIT    2    /* critical conditions */
  57. #define LOG_ERR        3    /* error conditions */
  58. #define LOG_WARNING    4    /* warning conditions */
  59. #define LOG_NOTICE    5    /* normal but signification condition */
  60. #define LOG_INFO    6    /* informational */
  61. #define LOG_DEBUG    7    /* debug-level messages */
  62.  
  63. #define LOG_PRIMASK    0x0007    /* mask to extract priority part (internal) */
  64. #define LOG_PRI(p)    ((p) & LOG_PRIMASK)    /* extract priority */
  65.  
  66. #define    LOG_MAKEPRI(fac, pri)    (((fac) << 3) | (pri))
  67.  
  68. #ifdef KERNEL
  69. #define LOG_PRINTF    -1    /* pseudo-priority to indicate use of printf */
  70. #endif
  71.  
  72. /*
  73.  * arguments to setlogmask.
  74.  */
  75. #define    LOG_MASK(pri)    (1 << (pri))        /* mask for one priority */
  76. #define    LOG_UPTO(pri)    ((1 << ((pri)+1)) - 1)    /* all priorities through pri */
  77.  
  78. /*
  79.  *  Option flags for openlog.
  80.  *
  81.  *    LOG_ODELAY no longer does anything; LOG_NDELAY is the
  82.  *    inverse of what it used to be.
  83.  */
  84. #define    LOG_PID        0x01    /* log the pid with each message */
  85. #define    LOG_CONS    0x02    /* log on the console if errors in sending */
  86. #define    LOG_ODELAY    0x04    /* delay open until first syslog() (default) */
  87. #define LOG_NDELAY    0x08    /* don't delay open */
  88. #define LOG_NOWAIT    0x10    /* if forking to log on console, don't wait() */
  89.  
  90. #ifdef AMIGA
  91.  
  92. #include <exec/types.h>
  93. #include <exec/ports.h>
  94.  
  95.     /* error values returned in errno if function returns -1 */
  96.  
  97. #define SYSLOGB_WINDOWOPEN  0
  98. #define SYSLOGB_WINDOWWRITE 1
  99. #define SYSLOGB_FILEOPEN    2
  100. #define SYSLOGB_FILEWRITE   4
  101.  
  102. #define SYSLOGF_WINDOWOPEN   ( 1 << SYSLOGB_WINDOWOPEN )
  103. #define SYSLOGF_WINDOWWRITE  ( 1 << SYSLOGB_WINDOWWRITE )
  104. #define SYSLOGF_FILEOPEN     ( 1 << SYSLOGB_FILEOPEN )
  105. #define SYSLOGF_FILEWRITE    ( 1 << SYSLOGB_FILEWRITE )
  106.  
  107. #endif
  108.